package com.zhiwang.planet.ui.webview_ultimate

import android.webkit.ConsoleMessage
import android.webkit.WebView
import com.zhiwang.planet.App
import com.zhiwang.planet.BuildConfig
import com.zhiwang.planet.ui.WebViewPageHandler
import com.zhiwang.planet.util.ChannelUtil
import com.zhiwang.planet.util.TokenManager

open class InterceptorAdapter : Interceptor {


    fun webViewHeader(): Map<String, String> {
        return mapOf(
                Pair("appdevice", "android")
                , Pair("plat", ChannelUtil.getChannel(App.instance))
                , Pair("apptoken", TokenManager.webviewHeaderToken())
                , Pair("appversion", BuildConfig.VERSION_CODE.toString())
                , Pair("Referer", "http://www.shandw.com")
                , Pair("mtype", "xiangguo")


        )
    }

    override fun initLoad(webView: WebView, url: String) {

    }

    override fun onPrepareSetting(webView: WebView) {

    }

    override fun onGoBack(handler: WebViewPageHandler, webView: WebView): Boolean {
        return false

    }


    override fun onPageStart(webView: WebView) {

    }

    override fun onPageFinish(webView: WebView) {

    }

    override fun onPageProgress(webView: WebView, progress: Int) {

    }

    override fun shouldInterceptUrlLoading(webView: WebView, url: String): Boolean {

        return false
    }

    override fun onConsoleMessage(webView: WebView, consoleMessage: ConsoleMessage): Boolean {

        return false
    }

    override fun onDestroy() {

    }

    override fun onResume(webView: WebView) {

    }

    override fun onPause(webView: WebView) {

    }

    override fun onStop(webView: WebView) {

    }


}